'use strict';

module.exports = {
  up: (queryInterface, Sequelize) => {
    const { INTEGER, STRING, DATE, ENUM, TEXT } = Sequelize;
    return queryInterface.createTable('menus', {
      id: {
        type: INTEGER(20),
        primaryKey: true,
        autoIncrement: true
      },
      menuname: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: '菜单名',
        unique: true
      },
      menupath: {
        type: STRING(160),
        allowNull: false,
        defaultValue: '',
        comment: '菜单路径',
      },
      icon: {
        type: STRING(30),
        allowNull: false,
        defaultValue: '',
        comment: '图标'
      },
      fatherpath: {
        type: STRING(160),
        allowNull: false,
        defaultValue: '',
        comment: '父路径'
      },
      created_time: DATE,
      updated_time: DATE,
      deleted_time: DATE
    });
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('menus');
  }
};
